package fosu.generated.common;

/**
 * 响应状态码枚举
 */
public enum ResultCode {

    // 成功
    SUCCESS(200, "操作成功"),

    // 客户端错误 4xx
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "无权限"),
    NOT_FOUND(404, "资源不存在"),

    // 业务错误 5xx
    INTERNAL_ERROR(500, "服务器内部错误"),

    // 用户相关错误 1000-1099
    USER_NOT_FOUND(1001, "用户不存在"),
    USER_ALREADY_EXISTS(1002, "用户已存在"),
    PASSWORD_ERROR(1003, "密码错误"),
    USERNAME_OR_PASSWORD_ERROR(1004, "用户名或密码错误"),
    PHONE_ALREADY_REGISTERED(1005, "手机号已注册"),
    USERNAME_OR_PHONE_MISMATCH(1006, "用户名或手机号不匹配"),

    // 论文相关错误 2000-2099
    PAPER_NOT_FOUND(2001, "论文不存在"),
    PAPER_UPLOAD_FAILED(2002, "论文上传失败"),
    PAPER_DETECTION_FAILED(2003, "论文检测失败"),
    PAPER_REWRITE_FAILED(2004, "论文改写失败"),
    PAPER_FORMAT_ERROR(2005, "论文格式错误"),
    PAPER_FILE_TOO_LARGE(2006, "论文文件过大"),

    // 段落相关错误 3000-3099
    PARAGRAPH_NOT_FOUND(3001, "段落不存在"),

    // 检测相关错误 4000-4099
    DETECTION_SERVICE_ERROR(4001, "检测服务异常"),
    REWRITE_SERVICE_ERROR(4002, "改写服务异常");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 消息
     */
    private final String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
